package com.ourteam.product.model.domain;

import net.dao.IDataPopulateCallback;

import org.apache.commons.beanutils.BeanMap;
import org.apache.commons.lang.ArrayUtils;

import java.util.HashMap;

/**
 * Template Name : DTO数据对象
 * Template Version : 1
 * Template Last Modfiy Date : Tue Nov 07 10:29:34 IRKT 2017
 * Auto Generate Date : 2017-11-15 14:51:50
  * Warning ! This file will be overwrite when regenerate !
  *
 */
import java.util.Map;


public class ProductModelPropertyBean implements java.io.Serializable {
    private static Map<String, String> mappedDaoFields = new HashMap<String, String>();

    static {
        mappedDaoFields.put("id",
            com.ourteam.product.model.dao.IProductModelPropertyDAO.Id);

        mappedDaoFields.put("objectId",
            com.ourteam.product.model.dao.IProductModelPropertyDAO.ObjectId);

        mappedDaoFields.put("propertyCode",
            com.ourteam.product.model.dao.IProductModelPropertyDAO.PropertyCode);

        mappedDaoFields.put("propertyName",
            com.ourteam.product.model.dao.IProductModelPropertyDAO.PropertyName);

        mappedDaoFields.put("dataTypeId",
            com.ourteam.product.model.dao.IProductModelPropertyDAO.DataTypeId);

        mappedDaoFields.put("dataLength",
            com.ourteam.product.model.dao.IProductModelPropertyDAO.DataLength);

        mappedDaoFields.put("dataAccuracy",
            com.ourteam.product.model.dao.IProductModelPropertyDAO.DataAccuracy);

        mappedDaoFields.put("isArray",
            com.ourteam.product.model.dao.IProductModelPropertyDAO.IsArray);

        mappedDaoFields.put("isAllowNull",
            com.ourteam.product.model.dao.IProductModelPropertyDAO.IsAllowNull);

        mappedDaoFields.put("isPrimaryKey",
            com.ourteam.product.model.dao.IProductModelPropertyDAO.IsPrimaryKey);

        mappedDaoFields.put("isAutoInc",
            com.ourteam.product.model.dao.IProductModelPropertyDAO.IsAutoInc);

        mappedDaoFields.put("sortIndex",
            com.ourteam.product.model.dao.IProductModelPropertyDAO.SortIndex);

        mappedDaoFields.put("status",
            com.ourteam.product.model.dao.IProductModelPropertyDAO.Status);

        mappedDaoFields.put("remarks",
            com.ourteam.product.model.dao.IProductModelPropertyDAO.Remarks);

        mappedDaoFields.put("objectName",
            com.ourteam.product.model.dao.IProductModelPropertyDAO.ObjectName);

        mappedDaoFields.put("objectCode",
            com.ourteam.product.model.dao.IProductModelPropertyDAO.ObjectCode);

        mappedDaoFields.put("objectType",
            com.ourteam.product.model.dao.IProductModelPropertyDAO.ObjectType);

        mappedDaoFields.put("dataType",
            com.ourteam.product.model.dao.IProductModelPropertyDAO.DataType);

        mappedDaoFields.put("defaultValue",
            com.ourteam.product.model.dao.IProductModelPropertyDAO.DefaultValue);

        mappedDaoFields.put("isUnique",
            com.ourteam.product.model.dao.IProductModelPropertyDAO.IsUnique);

        mappedDaoFields.put("submitterId",
            com.ourteam.product.model.dao.IProductModelPropertyDAO.SubmitterId);

        mappedDaoFields.put("creatorName",
            com.ourteam.product.model.dao.IProductModelPropertyDAO.CreatorName);

        mappedDaoFields.put("createTime",
            com.ourteam.product.model.dao.IProductModelPropertyDAO.CreateTime);

        mappedDaoFields.put("lastModifierName",
            com.ourteam.product.model.dao.IProductModelPropertyDAO.LastModifierName);

        mappedDaoFields.put("lastModifyTime",
            com.ourteam.product.model.dao.IProductModelPropertyDAO.LastModifyTime);
    }

    private com.ourteam.product.model.dao.ProductModelProperty productModelProperty;

    public ProductModelPropertyBean() {
        super();

        this.productModelProperty = new com.ourteam.product.model.dao.ProductModelProperty();
    }

    public ProductModelPropertyBean(
        com.ourteam.product.model.dao.ProductModelProperty productModelProperty) {
        super();

        this.productModelProperty = productModelProperty;
    }

    protected BeanMap getBeanMap() {
        return new BeanMap(productModelProperty);
    }

    public static String getMappedDAOField(String aAttrName) {
        return mappedDaoFields.get(aAttrName);
    }

    public com.ourteam.product.model.dao.ProductModelProperty convertToProductModelProperty() {
        return this.productModelProperty;
    }

    public com.ourteam.product.model.dao.ProductModelProperty convertTo() {
        return this.productModelProperty;
    }

    /**
     * Get id
     *
     * @return long
     */
    public long getId() {
        return (long) this.productModelProperty.getId();
    }

    /**
     * Set id
     *
     * @parameter long
     */
    public void setId(long id) {
        this.productModelProperty.setId(id);
    }

    /**
     * Get objectId
     *
     * @return long
     */
    public long getObjectId() {
        return (long) this.productModelProperty.getObjectId();
    }

    /**
     * Set objectId
     *
     * @parameter long
     */
    public void setObjectId(long objectId) {
        this.productModelProperty.setObjectId(objectId);
    }

    /**
     * Get propertyCode
     *
     * @return String
     */
    public String getPropertyCode() {
        return (String) this.productModelProperty.getPropertyCode();
    }

    /**
     * Set propertyCode
     *
     * @parameter String
     */
    public void setPropertyCode(String propertyCode) {
        this.productModelProperty.setPropertyCode(propertyCode);
    }

    /**
     * Get propertyName
     *
     * @return String
     */
    public String getPropertyName() {
        return (String) this.productModelProperty.getPropertyName();
    }

    /**
     * Set propertyName
     *
     * @parameter String
     */
    public void setPropertyName(String propertyName) {
        this.productModelProperty.setPropertyName(propertyName);
    }

    /**
     * Get dataTypeId
     *
     * @return long
     */
    public long getDataTypeId() {
        return (long) this.productModelProperty.getDataTypeId();
    }

    /**
     * Set dataTypeId
     *
     * @parameter long
     */
    public void setDataTypeId(long dataTypeId) {
        this.productModelProperty.setDataTypeId(dataTypeId);
    }

    /**
     * Get dataLength
     *
     * @return int
     */
    public int getDataLength() {
        return (int) this.productModelProperty.getDataLength();
    }

    /**
     * Set dataLength
     *
     * @parameter int
     */
    public void setDataLength(int dataLength) {
        this.productModelProperty.setDataLength(dataLength);
    }

    /**
     * Get dataAccuracy
     *
     * @return int
     */
    public int getDataAccuracy() {
        return (int) this.productModelProperty.getDataAccuracy();
    }

    /**
     * Set dataAccuracy
     *
     * @parameter int
     */
    public void setDataAccuracy(int dataAccuracy) {
        this.productModelProperty.setDataAccuracy(dataAccuracy);
    }

    /**
     * Get isArray
     *
     * @return String
     */
    public String getIsArray() {
        return (String) this.productModelProperty.getIsArray();
    }

    /**
     * Set isArray
     *
     * @parameter String
     */
    public void setIsArray(String isArray) {
        this.productModelProperty.setIsArray(isArray);
    }

    /**
     * Get isAllowNull
     *
     * @return String
     */
    public String getIsAllowNull() {
        return (String) this.productModelProperty.getIsAllowNull();
    }

    /**
     * Set isAllowNull
     *
     * @parameter String
     */
    public void setIsAllowNull(String isAllowNull) {
        this.productModelProperty.setIsAllowNull(isAllowNull);
    }

    /**
     * Get isPrimaryKey
     *
     * @return String
     */
    public String getIsPrimaryKey() {
        return (String) this.productModelProperty.getIsPrimaryKey();
    }

    /**
     * Set isPrimaryKey
     *
     * @parameter String
     */
    public void setIsPrimaryKey(String isPrimaryKey) {
        this.productModelProperty.setIsPrimaryKey(isPrimaryKey);
    }

    /**
     * Get isAutoInc
     *
     * @return String
     */
    public String getIsAutoInc() {
        return (String) this.productModelProperty.getIsAutoInc();
    }

    /**
     * Set isAutoInc
     *
     * @parameter String
     */
    public void setIsAutoInc(String isAutoInc) {
        this.productModelProperty.setIsAutoInc(isAutoInc);
    }

    /**
     * Get sortIndex
     *
     * @return int
     */
    public int getSortIndex() {
        return (int) this.productModelProperty.getSortIndex();
    }

    /**
     * Set sortIndex
     *
     * @parameter int
     */
    public void setSortIndex(int sortIndex) {
        this.productModelProperty.setSortIndex(sortIndex);
    }

    /**
     * Get status
     *
     * @return String
     */
    public String getStatus() {
        return (String) this.productModelProperty.getStatus();
    }

    /**
     * Set status
     *
     * @parameter String
     */
    public void setStatus(String status) {
        this.productModelProperty.setStatus(status);
    }

    /**
     * Get remarks
     *
     * @return String
     */
    public String getRemarks() {
        return (String) this.productModelProperty.getRemarks();
    }

    /**
     * Set remarks
     *
     * @parameter String
     */
    public void setRemarks(String remarks) {
        this.productModelProperty.setRemarks(remarks);
    }

    /**
     * Get objectName
     *
     * @return String
     */
    public String getObjectName() {
        return (String) this.productModelProperty.getObjectName();
    }

    /**
     * Get objectCode
     *
     * @return String
     */
    public String getObjectCode() {
        return (String) this.productModelProperty.getObjectCode();
    }

    /**
     * Get objectType
     *
     * @return String
     */
    public String getObjectType() {
        return (String) this.productModelProperty.getObjectType();
    }

    /**
     * Get dataType
     *
     * @return String
     */
    public String getDataType() {
        return (String) this.productModelProperty.getDataType();
    }

    /**
     * Set dataType
     *
     * @parameter String
     */
    public void setDataType(String dataType) {
        this.productModelProperty.setDataType(dataType);
    }

    /**
     * Get defaultValue
     *
     * @return String
     */
    public String getDefaultValue() {
        return (String) this.productModelProperty.getDefaultValue();
    }

    /**
     * Set defaultValue
     *
     * @parameter String
     */
    public void setDefaultValue(String defaultValue) {
        this.productModelProperty.setDefaultValue(defaultValue);
    }

    /**
     * Get isUnique
     *
     * @return String
     */
    public String getIsUnique() {
        return (String) this.productModelProperty.getIsUnique();
    }

    /**
     * Set isUnique
     *
     * @parameter String
     */
    public void setIsUnique(String isUnique) {
        this.productModelProperty.setIsUnique(isUnique);
    }

    /**
     * Get submitterId
     *
     * @return long
     */
    public long getSubmitterId() {
        return (long) this.productModelProperty.getSubmitterId();
    }

    /**
     * Set submitterId
     *
     * @parameter long
     */
    public void setSubmitterId(long submitterId) {
        this.productModelProperty.setSubmitterId(submitterId);
    }

    /**
     * Get creatorName
     *
     * @return String
     */
    public String getCreatorName() {
        return (String) this.productModelProperty.getCreatorName();
    }

    /**
     * Set creatorName
     *
     * @parameter String
     */
    public void setCreatorName(String creatorName) {
        this.productModelProperty.setCreatorName(creatorName);
    }

    /**
     * Get createTime
     *
     * @return java.util.Date
     */
    public java.util.Date getCreateTime() {
        return (java.util.Date) this.productModelProperty.getCreateTime();
    }

    /**
     * Set createTime
     *
     * @parameter java.util.Date
     */
    public void setCreateTime(java.util.Date createTime) {
        this.productModelProperty.setCreateTime(createTime);
    }

    /**
     * Get lastModifierName
     *
     * @return String
     */
    public String getLastModifierName() {
        return (String) this.productModelProperty.getLastModifierName();
    }

    /**
     * Set lastModifierName
     *
     * @parameter String
     */
    public void setLastModifierName(String lastModifierName) {
        this.productModelProperty.setLastModifierName(lastModifierName);
    }

    /**
     * Get lastModifyTime
     *
     * @return java.util.Date
     */
    public java.util.Date getLastModifyTime() {
        return (java.util.Date) this.productModelProperty.getLastModifyTime();
    }

    /**
     * Set lastModifyTime
     *
     * @parameter java.util.Date
     */
    public void setLastModifyTime(java.util.Date lastModifyTime) {
        this.productModelProperty.setLastModifyTime(lastModifyTime);
    }

    public int hashCode() {
        return org.apache.commons.lang.builder.HashCodeBuilder.reflectionHashCode(this);
    }

    public boolean equals(Object obj) {
        if (obj == null) {
            return false;
        } // end if

        if ((obj instanceof ProductModelPropertyBean) == false) {
            return false;
        } // end if

        ProductModelPropertyBean other = (ProductModelPropertyBean) obj;

        boolean isEqual = false;

        com.ourteam.product.model.dao.ProductModelProperty tempProductModelProperty =
            other.convertToProductModelProperty();

        if ((tempProductModelProperty == null) ||
                (this.productModelProperty == null)) {
            isEqual = false;
        } else if ((tempProductModelProperty == this.productModelProperty) ||
                tempProductModelProperty.equals(this.productModelProperty)) {
            isEqual = true;
        } else {
            isEqual = false;
        }

        return isEqual;
    }

    public static ProductModelPropertyBean[] toArray(
        com.ourteam.product.model.dao.ProductModelProperty[] aProductModelPropertys) {
        return toArray(aProductModelPropertys, null);
    }

    public static ProductModelPropertyBean[] toArray(
        com.ourteam.product.model.dao.ProductModelProperty[] aProductModelPropertys,
        IDataPopulateCallback aCallBack) {
        if (ArrayUtils.isEmpty(aProductModelPropertys)) {
            return new ProductModelPropertyBean[0];
        }

        int length = aProductModelPropertys.length;

        ProductModelPropertyBean[] beans = new ProductModelPropertyBean[length];

        for (int i = 0; i < length; i++) {
            beans[i] = new ProductModelPropertyBean(aProductModelPropertys[i]);

            if (aCallBack != null) {
                aCallBack.populate(beans[i],
                    new Object[] { aProductModelPropertys[i] });
            }
        }

        return beans;
    }
}
